package OOP.day10.AnimalDemo04;

public class MultiTypeDemo {
    public static void main(String[] args) {
        Dog dog01 = new Dog();
        dog01.lookHome(); //可以调狗的所有属性行为
        Animal dog02 = new Dog();
        dog02.eat(); //只能访问Animal类中的属性和eat()、drink()方法
        Swim dog03 = new Dog();
        dog03.swim(); //只能访问Swim接口中的swim()方法
    }
}
